﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls.WebParts;
using System.Web;
using System.Security.Permissions;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint;

namespace BDF.TagCloud.Utilities
{
    [AttributeUsage(AttributeTargets.Property), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.LinkDemand,Level=AspNetHostingPermissionLevel.Minimal)]
    public class LocalizedWebDisplayNameAttribute : WebDisplayNameAttribute
    {
        private String _displayName;
        public static new readonly WebDisplayNameAttribute Default = new WebDisplayNameAttribute();

        public LocalizedWebDisplayNameAttribute() : this(String.Empty) { }

        public LocalizedWebDisplayNameAttribute(String s) {
            this._displayName = SPUtility.GetLocalizedString("$Resources:" + s, "TagCloudFeature", SPContext.Current.Web.Language); 
        }

        public override String DisplayName
        {
            get
            {
                return this.DisplayNameValue;
            }           
        }

        protected new String DisplayNameValue
        {
            get { return this._displayName; }
            set { this._displayName = value; }
        }
    }
}
